<template>
  <div>
      <div class="bg"  :style="{height:getWindowHeight+'px'}">
          <div class="fan_qrcode_bg" :style="fan_qrcode_bg">
              <img :src="fans_qrcode" alt="">
          </div>
      </div>
  </div>
</template>
<script>

export default {
    data(){
        return{
            fan_qrcode_bg:{
                backgroundImage: "url(" + require("../../assets/streamlog01@2x.png") + ")",
                backgroundRepeat: "no-repeat",
                backgroundSize: "cover"
            },
            fans_qrcode:""
        }
    },
    methods:{
        getStreamLog(){
            let that = this;
            const toast = that.$createToast({
                time: 1000,
                txt: ''
              })
              toast.show()
            let url = "/fang/personal/fan_qrcode";
            that.$axios.post(url,that.$qs.stringify({
                access_token:that.$store.state._token01
            }))
            .then(function(response){
                toast.hide();
                let res = response.data;
                console.log(response)
                if(res.status == 1){
                    that.fans_qrcode = res.data.item.fans_qrcode;
                }else if (res.status == -1) {
                    that.noLogin();
                }else{
                    that.toast = that.$createToast({
                      txt: res.msg,
                      type: 'txt'
                    })
                    that.toast.show()
                }
            })
            .catch(function(error){
                console.log(error);
                that.toast = that.$createToast({
                  txt: error.toString(),
                  type: 'txt'
                })
                that.toast.show()
            });
        },
   },
   mounted(){
       this.getStreamLog();
   },
   metaInfo: {
     title: "我要推广"
    },
   computed: {
       getWindowHeight(){
         return document.documentElement.clientHeight || document.body.clientHeight;
       },
   }
}
</script>
<style scoped>
.bg{
    background: #f46450;
}
.fan_qrcode_bg{
    height: 20.28rem;
    position: relative;
}
.fan_qrcode_bg img{
    width: 7rem;
    height: 7rem;
    position: absolute;
    left: 50%;
    top: 8.5rem;
    transform: translate(-50%, 0);
}
</style>
